package com.tanhua.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.Log;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface LogMapper extends BaseMapper<Log> {

    @Select("select distinct COUNT(user_Id) from tb_log where type=#{type} and log_time=#{time}")
    Integer findNumRegistered(@Param("type") String s, @Param("time")String time);

    @Select("select distinct COUNT(user_Id) from tb_log  where log_time=#{time}")
    Integer findNumActive(@Param("time") String time);

    @Select("select distinct COUNT(user_Id) from tb_log where type='0102' and log_time=#{yesterday} and user_id in\n" +
            "(select distinct user_Id from tb_log  where log_time=#{time})")
    Integer findNumRetention1d(@Param("yesterday") String yesterday, @Param("time") String time);
}